using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class TPI_APPMap : EntityTypeConfiguration<TPI_APP>
    {
        public TPI_APPMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Code)
                .HasMaxLength(20);

            this.Property(t => t.PatientNB)
                .HasMaxLength(20);

            this.Property(t => t.AppointmentTime)
                .HasMaxLength(10);

            this.Property(t => t.PhysicianCode)
                .HasMaxLength(20);

            this.Property(t => t.RoomCode)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("TPI_APP");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Code).HasColumnName("Code");
            this.Property(t => t.PatientNB).HasColumnName("PatientNB");
            this.Property(t => t.BookDate).HasColumnName("BookDate");
            this.Property(t => t.AppointmentDate).HasColumnName("AppointmentDate");
            this.Property(t => t.AppointmentTime).HasColumnName("AppointmentTime");
            this.Property(t => t.Duration).HasColumnName("Duration");
            this.Property(t => t.PhysicianCode).HasColumnName("PhysicianCode");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.RoomCode).HasColumnName("RoomCode");
        }
    }
}
